'use strict';
const bcrypt = require('bcryptjs')
/** @type {import('sequelize-cli').Migration} */
module.exports = {
  async up (queryInterface, Sequelize) {
    /**
     * Add seed commands here.
     *
     * Example:
     * await queryInterface.bulkInsert('People', [{
     *   name: 'John Doe',
     *   isBetaMember: false
     * }], {});
    */
    await queryInterface.bulkInsert('Users', [
      {
        email:'3190804443@qq.com',
        username:'admin',
        password:bcrypt.hashSync('123456',10),
        nickname:'Silverhand',
        sex:0,//0代表男
        role:100,//100代表管理员，0代表普通用户
        createdAt:new Date(),
        updatedAt:new Date(),
      },
      {
        email:'123@123.com',
        username:'user',
        password:bcrypt.hashSync('123456',10),
        nickname:'普通用户',
        sex:2,//2代表未选择性别
        role:0,//100代表管理员，0代表普通用户
        createdAt:new Date(),
        updatedAt:new Date(),
      },
    ], {})
  },

  async down (queryInterface, Sequelize) {
    /**
     * Add commands to revert seed here.
     *
     * Example:
     * await queryInterface.bulkDelete('People', null, {});
     */
    await queryInterface.bulkDelete('Users', null, {})
  }
};
